package com.yanqu.road.server.cmd.activity.zhenhuan.second;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.ZhenHuanProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.zhenhuan.CrossZhenHuanMgr;
import com.yanqu.road.server.manager.activity.zhenhuan.CrossZhenHuanSecondActivity;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_ZHENHUAN_SECOND_PROCESS_ALL_PARTY_LIST, desc = "请求所有茶话会列表")
public class CrossZhenHuanSecondProcessAllPartyCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        ZhenHuanProto.ZhenHuanSecondProcessAllPartyListReqMsg reqMsg = ZhenHuanProto.ZhenHuanSecondProcessAllPartyListReqMsg.parseFrom(packet.getBytes());
        CrossZhenHuanSecondActivity secondActivity = CrossZhenHuanMgr.getSecondActivity(reqMsg.getActivityId());
        if (secondActivity == null) {
            return;
        }
        secondActivity.sendAllPartyListMsg(packet.getPlayerId(), serverId, reqMsg);
    }

    @Override
    public void sendData() {

    }
}
